package com.test2;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.Inet4Address;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.alibaba.fastjson.JSON;

public class Test3 {
	
	static int i = 3;
	
	static void increment() {
//		String lineTxt = "lizhao,";
//		String[] param = lineTxt.split(",");//分割参数 RuoYouShiWu,19512
//		String userid = param[0];
//		String depa_id = param[1];
//		System.err.println(userid);
//		System.err.println(JSON.toJSONString(Arrays.asList(depa_id)));
	}
	
	public static void main(String[] args) throws UnknownHostException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
//		Calendar calendar=Calendar.getInstance();  
//		calendar.setTime(new Date());
//		calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)+365);//让日期加365天
//		SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
//		System.out.println(df.format(calendar.getTime()));
		
		//System.out.println(Inet4Address.getLocalHost().getHostAddress());

//		Object a = 123456;
//		System.out.println(a instanceof Integer);
//		Integer b = 123456;
//		System.out.println(a.equals(b));
		Test3 te = new Test3();
		te.up();
	}
	
	
	public void up() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
		
		Class clazz = this.getClass();
		Method[] methods = clazz.getMethods();
		for(Method method:methods) {
			System.out.println(method.getName());
			String meName = method.getName();
			if(meName.equals("set")) {
				method.invoke(meName);
			}
		}
		try {
//			this.set();

		} catch (Exception e) {
//			Class clazz = this.getClass();
//			Method[] methods = clazz.getMethods();
//			for(Method method:methods) {
//				System.out.println(method.getName());
//				String meName = method.getName();
//				if(meName.equals("set")) {
//					method.invoke(meName);
//				}
//			}
//			Field[] fields = clazz.getFields();
//			for(int i = 0;i<fields.length;i++) {
//				Field fe = fields[i];
//				fe.setAccessible(true);
//				String errcode = fe.getName();
//				if(errcode.equals("errcode") || errcode.equals("errCode")) {
//					if(fe.get(errcode) instanceof Integer) {
//						fe.get(errcode).equals(errcode);
//					}
//				}
//			}
		}
	}
	
	public void set() {
		int a= 1/0;
	}

}
